package edu.auctionmart

class ItemController {
		
	def index() {
		redirect(action: list)
	}
	
	def show = {
		def view = "showWeb"
		
		withMobileDevice {
			def device ->
			println device
			view = "showMobile"
		}
		
		def item = Item.get(params.id)
		if (!item) {
			flash.message = "Item not found with id $params.id"
			redirect action: list
			return
		}
		render (view: view, model: [itemInstance: item])
	}
}
	
